<template>
   <header class="header">
    <h1>小黑记事本</h1>
    <input 
    @keyup.enter="assTask"
    placeholder="请输入任务" 
    class="new-todo"
    v-model="TodoName" />
    <button class="add" @click="addTask">添加任务</button>
  </header>
</template>

<script>
export default {
data(){
  return{
    TodoName:''
  }
},
methods:{
  addTask(){
    this.$emit('addTodoName',this.TodoName)
    this.TodoName=''
  }
}
}
</script>

<style>

</style>